#include <iostream>
using namespace std;

class FileError {};
class MemoryError {};

void foo (void) /*throw()*/{
	throw -1;
	throw MemoryError();
	throw FileError();
}

int main (void)
{
	try {
		foo ();
	}
	catch (FileError& ex) {
		cout << "文件错误" << endl;
		return -1;
	}
	catch (MemoryError& ex) {
		cout << "内存错误" << endl;
		return -1;
	}
	catch (...) {
		cout << "其他错误" << endl;
		return -1;
	}
	return 0;
}
